'''
classify.py
'''

def classify_and_show_mistakes(classifier, test_featuresets, test_docs):
    test_docs_for_features = [i[0] for i in test_docs]
    print "BLEDNE PRZYPORZADKOWANIA DO KLAS:"
    print "I - polozenie w zbiorze testowym"
    print "K - wynik klasyfikacji NaiveBayesClassifier"
    print "LP\tI|K\tPLIK"
    i = 1
    for j, d in enumerate(test_featuresets):
        (feature_set, correct_class) = d
        result_class = classifier.classify(feature_set)
        if result_class != correct_class:
            i += 1
            print "%d.\t%s|%s\t%s" % (i, correct_class, result_class, test_docs_for_features[j])
    pass